﻿/**
 *
 * @title: Basic MVC Framework, View Interface definition
 * @author: Robert Turrall (http://www.robertturrall.com)
 * @license: Creative Commons Attribution 3.0 (http://creativecommons.org/licenses/by/3.0/)
 *			In other words: Please feel free to use, change, redistribute and do what you want with 
 *			this code. Just keep the original header and author attribution intact. Follow the license
 *			link for more info.
 * @updated: 31/12/2008
 *
 * @version	1.0 
 */

package net.turrall.mvc {

	import net.turrall.mvc.*;
	import flash.events.EventDispatcher;
	import flash.events.MouseEvent;
	import flash.events.Event;
	/**
	 * Minimum services that a "view" class
	 * of a Model/View/Controller triad must provide.
	 */
	interface View {
		/**
		 * Sets the model this view is observing.
		 */
		function setModel(m:EventDispatcher):void;
		
		/**
		 * Returns the model this view is observing.
		 */
		function getModel():EventDispatcher;
		
		/**
		 * Sets the controller for this view.
		 */
		function setController(c:Controller):void;
		
		/**
		 * Returns this view's controller.
		 */
		function getController(e:MouseEvent):Controller;
		
		/**
		 * Returns the default controller for this view.
		 */
		function defaultController(model:EventDispatcher):Controller;
		
		/**
		 * Called when model updates
		 */
		function update(e:CustomEvent):void;
	}
}